package com.yaodian100.ec.product.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import com.yaodian100.core.common.entity.BaseEntity;

@Entity
@Table(name = "EC_PRODUCT_CATEGORY")
public class ProductCategory extends BaseEntity {

	/**
	 * serial version
	 */
	private static final long serialVersionUID = -7354062159024207367L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "seq_ec_product_category")
	@SequenceGenerator(name = "seq_ec_product_category", sequenceName = "SEQ_EC_PRODUCT_CATEGORY")
	@Column(name = "PRODCUT_CATEGORY_ID")
	private Long id;

	// @ManyToOne(fetch = FetchType.LAZY)
	// @JoinColumn(name = "PRODUCT_ID")
	// @OrderBy("showSeq asc,productId asc")
	// private Product product;
	// @Column(name = "PRODUCT_ID", length = 8, insertable = false, updatable = false)
	// private String productId;

	@Column(name = "PRODUCT_ID", length = 8)
	private String productId;

	@Column(name = "CATEGORY_ID")
	private Long categoryId;
	@Column(name = "CATEGORY_PATH", length = 100)
	private String categoryPath;

	@Column(name = "CATEGORY_NAME", length = 40)
	private String categoryName;

	/**
	 * 显示顺序(1~9,default 1 ，由小排到大，1最小)
	 */
	@Column(name = "SHOW_SEQ")
	private int showSeq;

	/**
	 * @return the categoryId
	 */
	public Long getCategoryId() {
		return categoryId;
	}

	/**
	 * @return the categoryName
	 */
	public String getCategoryName() {
		return categoryName;
	}

	/**
	 * @return the categoryPath
	 */
	public String getCategoryPath() {
		return categoryPath;
	}

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @return the productId
	 */
	public String getProductId() {
		return productId;
	}

	public int getShowSeq() {
		return showSeq;
	}

	/**
	 * @param categoryId the categoryId to set
	 */
	public void setCategoryId(Long categoryId) {
		this.categoryId = categoryId;
	}

	/**
	 * @param categoryName the categoryName to set
	 */
	public void setCategoryName(String categoryName) {
		this.categoryName = categoryName;
	}

	/**
	 * @param categoryPath the categoryPath to set
	 */
	public void setCategoryPath(String categoryPath) {
		this.categoryPath = categoryPath;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @param productId the productId to set
	 */
	public void setProductId(String productId) {
		this.productId = productId;
	}

	public void setShowSeq(int showSeq) {
		this.showSeq = showSeq;
	}
}
